package com.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller //相当与@Component IDC注册bean类
public class FirstController {
    @RequestMapping("/firstController") //映射网址
    public String sayHello(){
        System.out.println("访问到FirstController!");
        //设定具体跳转的页面
        return "success"; //自动拼接为/WEB-INF/pages/success.jsp
}
public class firstController {
    @RequestMapping(value = "/springMVC")
    public void sayHello() {
        System.out.println("Hello SpringMVC!");
    }
    }
}
